package com.sy.demo;

import com.sy.processor.bean.MyInitializingBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * InitializingBean 不能直接独立，要由组件实现
 */
@Component
public class Cat implements InitializingBean {

	public Cat() {
		System.out.println("Cat 猫被创建了");
	}

	private String name;

	@Value("${JAVA_HOME}")
	public void setName(String name) {
		System.out.println("Cat .... setName 被调用");
		this.name = name;
	}

	public String getName() {
		return name;
	}

	@Override
	public void afterPropertiesSet() throws Exception {
		System.out.println("cat... afterPropertiesSet.. ");
	}

}
